package com.itheima.controller;

import cn.hutool.core.lang.Snowflake;
import com.itheima.common.R;
import com.itheima.entity.vo.category.CategoryListVo;
import com.itheima.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author huangzelnag
 * @create 2022-05-12
 */
@RestController
@RequestMapping("category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;


    /**
     * 获取分类列表
     * @return
     */
    @GetMapping("list")
    public  R getCategoryList(){

        new Snowflake();

    List<CategoryListVo> list= categoryService.getCategoryList();
        return R.success(list);
    }

}
